﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Yoze.Common.Messaging
{
    /// <summary>
    /// 消息队列订阅者(消费者), 表示实现的类可以订阅消息队列，并触发有任何传入消息的事件。
    /// </summary>
    /// <remarks>This class will not be responsible for classifying the message by its topic.</remarks>
    public interface IMessageSubscriber : IDisposable
    {
        /// <summary>
        /// 订阅消息队列。
        /// </summary>
        void Subscribe();

        /// <summary>
        /// 收到消息时发生的事件。
        /// </summary>
        event EventHandler<MessageReceivedEventArgs> MessageReceived;
    }
}
